<template>
  <div>
       <el-form :model="upd">
                <el-form-item label="">医生姓名：
                    <el-input v-model="upd.doctorName" placeholder="请输入信息" style="width: 500px"></el-input>
                </el-form-item>
                <el-form-item label="">医生图片：
                    <el-input v-model="upd.img" placeholder="请输入信息" style="width: 500px"></el-input>
                </el-form-item>
                <el-form-item label="">院区：
                   <el-select v-model="upd.campusName" placeholder="请选择" style="width: 500px" >
                    <el-option
                    v-for="item in options"
                    :key="item.id"
                    :label="item.campusName"
                    :value="item.id">
                    </el-option>
                </el-select>
              </el-form-item>

                <el-form-item label="">职称：
                    <el-input v-model="upd.jobTitle" placeholder="请输入信息" style="width: 500px"></el-input>
                </el-form-item>
                <el-form-item label="">科室：
                   <el-select v-model="upd.divisionName" placeholder="请选择" style="width: 500px" >
                    <el-option
                    v-for="item in options"
                    :key="item.id"
                    :label="item.divisionName"
                    :value="item.id">
                    </el-option>
                </el-select>
              </el-form-item>
                <el-form-item label="">标签：
                    <el-input v-model="upd.labels" placeholder="请输入信息" style="width: 500px"></el-input>
                </el-form-item>
                <el-form-item label="">医生简介：
                    <el-input v-model="upd.introduction" placeholder="请输入信息" style="width: 500px"></el-input>
                </el-form-item>
                <el-button type="primary" @click="updDoctor()">确定</el-button>
                <el-button type="primary" @click="quxiao()">取消</el-button>
                
              </el-form>
  </div>
</template>

<script>
export default {
    created(row){
        this.option();
        this.upd=this.$route.query.row
        console.log(row)
    },
    data(){
        return{
            options:[],
            upd:'',
            
        }
    },
    methods:{
        option() {
            this.$axios.get("/user/user/doctor/ren/findDoctorAll").then((res) => {
                console.log(res.data.data.list);
                this.options = res.data.data.list;
            })
        },
        updDoctor(){
            this.$axios.post("/user/user/doctor/ren/updDoctor",this.upd).then(res=>{
                this.upd={};
                this.$router.push({path:'/DoctorManagement' })
            })
        },
         quxiao(){
            this.$router.push({path:'/DoctorManagement' })
        }
    }
}
</script>

<style>

</style>